package com.situ.mall.controller.back;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.situ.mall.common.ServerResponse;
import com.situ.mall.entity.Shipping;
import com.situ.mall.service.IShippingService;

@RequestMapping("/shipping")
@Controller
public class ShippingController {
	@Autowired
	private IShippingService shippingService;

	@RequestMapping("/getShippingPage")
	public String getShippingPage() {
		return "/shipping/shipping_list";
	}
	
	@RequestMapping("/list")
	@ResponseBody
	public List<Shipping> list() {
		return shippingService.list();
	}
	
	@RequestMapping("/pageList")
	@ResponseBody
	public ServerResponse pageList(Integer page, Integer limit, Shipping shipping) {
		ServerResponse serverResponse = shippingService.pageList(page, limit, shipping);
		System.out.println(serverResponse);
		return serverResponse;
	}
	
	@RequestMapping("/deleteById")
	@ResponseBody
	public ServerResponse deleteById(Integer id) {
		return shippingService.deleteById(id);
	}
	
	@RequestMapping("/deleteAll")
	@ResponseBody
	public ServerResponse deleteAll(String ids) {
		return shippingService.deleteAll(ids);
	}
}
